package com.center.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.center.R;
import com.center.model.AnimeHistoryModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import org.w3c.dom.Text;

import java.util.List;

import anime.play.room.AnimePlayHistoryModel;
import pic.PicLoadManager;

public  class AnimeHistoryAdapter extends BaseQuickAdapter<AnimeHistoryModel, BaseViewHolder> {
    public AnimeHistoryAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<AnimeHistoryModel> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AnimeHistoryModel item) {
        ImageView pic = helper.itemView.findViewById(R.id.pic);
        TextView tv_title_name = helper.itemView.findViewById(R.id.tv_title_name);
        PicLoadManager.loadPicture(item.getPic(),pic);
        helper.setText(R.id.tv_title,item.getName());
        helper.setText(R.id.tv_title_name,item.getTitleName());

        tv_title_name.setSelected(true);
    }


}
